﻿using System;
using System.Windows.Forms;
using Loki.UI.Test;

namespace Loki.UI.Win.Test.View
{
    public partial class MainView : Form
    {
        public MainView()
        {
            InitializeComponent();
        }

        private void BTN_Close_Click(object sender, EventArgs e)
        {
            ((ICloseable)Tag).TryClose(true);
        }

        private void BTN_Desactivate_Click(object sender, EventArgs e)
        {
            ((IDesactivable)Tag).Desactivate(false);
        }

        private void MainView_Load(object sender, EventArgs e)
        {
            ControlBinder.Navigation.Bind<MainViewModel>(this.bar_manager, mnu_main, x => x.Menu);
            ControlBinder.Navigation.Bind<MainViewModel>(this.NAV_Navigation, x => x.Navigation);
            ControlBinder.Document.Bind<MainViewModel>(this.document_manager, x => x.Documents);
        }

        private void tabbedView1_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e)
        {
            e.Control = new UserControl();
        }
    }
}